1. Field of the Invention
The present invention relates to a ranging apparatus, a ranging method and an imaging system, more particularly to a ranging apparatus and a ranging method which are used for an imaging system such as a digital still camera, a digital video camera, or the like.
2. Description of the Related Art
There are known distance detection techniques used for digital still cameras and video cameras. In Japanese Patent Application Laid-Open No. 2002-314062, a solid-state imaging device having a ranging function in a portion of pixels thereof, which is configured to detect a distance through a phase difference method, is proposed. This phase difference method includes processes of estimating a gap amount between optical images (respectively called as an A image and a B image, and also called as AB images collectively) produced by luminous fluxes having passed though different areas on a pupil of a camera lens and of calculating a defocus amount using triangulation with stereo images; ranging is thereby performed. According to this method, since any lens is not required to be moved for distance measurement, high-accurate and high-speed ranging is enabled unlike a conventional contrast method. Real-time ranging is also enabled when moving images are taken.
If vignetting in a luminous flux is caused by the frame of a taking lens or the like, the A and B images become different to each other, which causes the accuracy of estimating the image gap amount to be reduced and also the ranging accuracy to be degraded. An image-shape modification technique is disclosed in US 2012/0057043 A1. In this technique, image modification filters are formed using line spread functions corresponding to pupil areas for forming the A and B images. The shapes of the A and B images are modified by performing convolution integral on them with the image modification filters, respectively, after the filters have been mutually interchanged. Since the magnitude of the image modification filter (line spread function) varies depending on defocus amounts, the shape of the image modification filter is corrected in accordance with a calculated defocus amount, and the processes of modifying the images and recalculating the defocus amount are repeatedly performed. Desirable image modification filters are formed using a defocus amount close to the right value, which is acquired through such loop processing of the ranging calculation; thereby, the accuracy of image modification and distance measurement can be enhanced.
The AB images in the technique disclosed in US 2012/0057043 A1 are discrete data which are composed of the values acquired at respective pixels. In order to perform convolution integral on the respective images, the image modification filters are formed by discretizing the respective continuous line spread functions in accordance with arrangement spacing of pixels, taking the centroid positions of the respective continuous line spread functions as reference points. There is, however, a case in which the centroid position calculated from discrete values of the image modification filter differs from the reference point depending on the distance up to a subject (defocus amount). This error is called as a centroid error. If such a centroid error exists, the centroid position of a modified image deviates from that of the original image. The deviation causes an error to arise in estimated values of the image gap amount and the defocus amount. This centroid error is independent with respect to the shape error of the image modification filter, and even though loop processing of the ranging calculation is performed, either the centroid error or the shape error remains. The calculated values of the image gap amount and the defocus amount therefore do not converge, which causes the ranging time to increase and also causes the ranging accuracy to be degraded.